import EthereumCommon from '@ethereumjs/common';
import { coins, EthereumNetwork } from '@bitgo/statics';
import { BN } from 'ethereumjs-util';

export const baseChainCommon = EthereumCommon.custom({
  name: 'base sepolia',
  chainId: new BN(84532),
  networkId: new BN(84531),
  defaultHardfork: 'london',
});

export function getCommon(coin: string): EthereumCommon {
  return EthereumCommon.custom({
    name: coins.get(coin).name,
    networkId: (coins.get(coin).network as EthereumNetwork).chainId,
    chainId: (coins.get(coin).network as EthereumNetwork).chainId,
    defaultHardfork: 'london',
  });
}

export const WALLET_FACTORY_ADDRESS = '0x809ee567e413543af1caebcdb247f6a67eafc8dd';

export const PRIVATE_KEY_1 =
  'xprv9s21ZrQH143K3vYxF8BfcG8g82bkkrf962jYfdc2SdsbXzLRcnaWAD3jWMsQaTz9ZoqD7gvYeR3fRPZy3Fr2UFXrome67sTdb66wAFmcz6G';

export const TX_BROADCAST =
  '0xf9012d018502540be4008367c28094809ee567e413543af1caebcdb247f6a67eafc8dd80b8c47117f3fa000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000e6c43626f11312de29b0011fa9da71ea3bba0e9f00000000000000000000000078caeb4527170e52f54d936e4eef6f83250e01bb000000000000000000000000b1938215967408fff7c59c77ae5e5283b55c8e268302948ca03f87f549ef682294b05574646a6fc105173b8e803968a28b17fc5e24da65ed3aa03e5481642a64d66b52f8fd602810e47d430244fd465785a5123abaeaa40aac29';

export const RECOVERY_WALLET_BYTE_CODE =
  '0x6060604052341561000f57600080fd5b604051604080610307833981016040528080519190602001805160008054600160a060020a03958616600160a060020a0319918216179091556001805495909216941693909317909255505061029d8061006a6000396000f3006060604052600436106100615763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663238ac93381146100635780639bd9bbc6146100925780639de062de146100c1578063a68a76cc146100d4575b005b341561006e57600080fd5b6100766100e7565b604051600160a060020a03909116815260200160405180910390f35b341561009d57600080fd5b61006160048035600160a060020a03169060248035916044359182019101356100f6565b34156100cc57600080fd5b610076610157565b34156100df57600080fd5b610061610166565b600054600160a060020a031681565b60005433600160a060020a0390811691161461011157600080fd5b83600160a060020a03168383836040518083838082843782019150509250505060006040518083038185876187965a03f192505050151561015157600080fd5b50505050565b600154600160a060020a031681565b60015460009061017e90600160a060020a03166101ff565b600054909150600160a060020a03808316916319ab453c91166040517c010000000000000000000000000000000000000000000000000000000063ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156101ee57600080fd5b6102c65a03f1151561015157600080fd5b60006c0100000000000000000000000082026040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528160148201527f5af43d82803e903d91602b57fd5bf3000000000000000000000000000000000060288201526037816000f09493505050505600a165627a7a723058201258c4860824679860b6c01a7043a7a732ad65d265b4155d4f63620999a1392e0029';
